package com.jcz.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="vote_option")
public class Vote_Option {
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Integer vo_id;
	@Column
	private String vo_option;
	@Column
	private Integer vo_order;
	
	@ManyToOne(fetch=FetchType.EAGER,cascade={CascadeType.PERSIST})
	@JoinColumn(name="vs_id")
	private Vote_Subject vote_Subject;
	
	@OneToMany(mappedBy="options")
	private Set<Vote_Item> items=new HashSet<Vote_Item>();

	public Set<Vote_Item> getItems() {
		return items;
	}

	public void setItems(Set<Vote_Item> items) {
		this.items = items;
	}

	public Integer getVo_id() {
		return vo_id;
	}

	public void setVo_id(Integer vo_id) {
		this.vo_id = vo_id;
	}

	public String getVo_option() {
		return vo_option;
	}

	public void setVo_option(String vo_option) {
		this.vo_option = vo_option;
	}

	public Integer getVo_order() {
		return vo_order;
	}

	public void setVo_order(Integer vo_order) {
		this.vo_order = vo_order;
	}

	public Vote_Subject getVote_Subject() {
		return vote_Subject;
	}

	public void setVote_Subject(Vote_Subject vote_Subject) {
		this.vote_Subject = vote_Subject;
	}
	
	
}
